﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserGroups.aspx.cs" Inherits="Main_Utilities_UserGroups" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link href="../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        
        <div class="divmain" style="margin-top:5px; margin-bottom:15px">
            <acc:heading ID="pagehead" runat="server" HeadingText="User Group" />
        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <div align ="center"><asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label></div> 
         <asp:UpdateProgress DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1" ID="UpdProgress" runat="server">
        <ProgressTemplate>
          <div align="center"><img src="../../Images/ajax-loader.gif" /></div>
        </ProgressTemplate>
        </asp:UpdateProgress>
        <table class="tablecontent"  style= "width:40%;margin-left:30%; margin-right:30%;" >
              <tr>
                <td class="headtd" colspan="4"> 
                   Group Details
               </td>
             </tr>
             <tr>
                <td> Group Name <span class="required">*</span> </td>
                <td> <asp:TextBox ID="TxtGroupName" runat="server" ToolTip="Enter Group Name" Width="120px" ValidationGroup="name" CssClass ="input" ></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RFVCategoryName" runat="server" ValidationGroup="name" ControlToValidate="TxtGroupName" ErrorMessage="*" ></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td> Group Description</td>
                <td> <asp:TextBox ID="txtGroupDescription" runat="server" ToolTip="Enter Group Description" Width="120px" ValidationGroup="name" CssClass ="input" ></asp:TextBox>
                     
                </td>
            </tr>
           <tr>
               <td></td>
               <td>
                    <asp:Button ID="Insert" runat="server" Text="Create" CssClass="button" ValidationGroup="name"
                        onclick="Insert_Click" />                  
                </td>
            </tr>
        </table>
       </ContentTemplate>
       </asp:UpdatePanel>
        <div style="margin-left:25%; margin-right:25%; width:50%"> 
        <asp:UpdateProgress DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel2" ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
          <div align="center"><img src="../../Images/ajax-loader.gif" /></div>
        </ProgressTemplate>  
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
        <asp:GridView ID="GrdDisplay" runat="server"  Width="100%" AllowPaging="true"
               PageSize="10"   DataKeyNames="GroupID" AutoGenerateColumns="false" 
               CssClass="gridview" onrowediting="GridDisplay_RowEditing" EmptyDataText="No Records Found!" EmptyDataRowStyle-CssClass="emptyrow"
               onrowcancelingedit="GrdDisplay_RowCancelingEdit"  AlternatingRowStyle-CssClass="gridview_alternate"
               onrowupdating="GrdDisplay_RowUpdating" 
               onpageindexchanging="GrdDisplay_PageIndexChanging" >
            <Columns>
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="S.No.">
                    <ItemTemplate><%#Container.DataItemIndex+1%></ItemTemplate>
               </asp:TemplateField>
                <asp:BoundField HeaderText="Group Name" DataField="GroupName" />  
                <asp:BoundField HeaderText="Group Description" DataField="GroupDescription" /> 
                <asp:CommandField HeaderText="Action" EditText="<img src='../../Menu/images/Edit_user.png'>" ShowEditButton="true" UpdateText="<img src='../../Menu/images/update.png'>" CancelText="<img src='../../Menu/images/cancel.png'>" ItemStyle-HorizontalAlign="Center" /> 
            </Columns>     
            <PagerStyle HorizontalAlign="Right" />
        </asp:GridView>
        </ContentTemplate>
        </asp:UpdatePanel>
        </div>
        </div>
    
    </form>
</body>
</html>
